package com.auto.learning.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RadioGroup;

import com.auto.learning.R;

public class RadioButtonView extends RadioGroup {
	
	

	public RadioButtonView(Context context) {
		super(context);
	}

	public RadioButtonView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	
	
	
	@Override
	protected void onFinishInflate() {
		super.onFinishInflate();
		changeButtonsImages();
	}
	
	private void changeButtonsImages(){
		int count = super.getChildCount();

		if(count > 1){
			super.getChildAt(0).setBackgroundResource(R.drawable.collect_radio_left_1);
			for(int i = 1; i < count-1; i++){
				super.getChildAt(i).setBackgroundResource(R.drawable.radio_mid_2);
			}
			super.getChildAt(count-1).setBackgroundResource(R.drawable.collect_radio_right_3);
		}
	}
	

}
